{template header}


{template sidebar}

<!-- artile begin -->
<div class="article">
    {template title}





    <!--{if  $type == 'infoMan'}-->

    <!--{if  $a == 'index'|| $a == 'search_shopBrond' }-->
    <form class="form-search" action="{$this->url($c, 'search_shopBrond', $this->get())}">
        <table>
            <tr><td class="td1" width="30%"><input type="radio" name="keyType" value="1" checked="checked" />品牌名&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                <input type="radio" name="keyType" value="0" />店铺名</td>
                <td >

                    <div class="input-append">

                        <input type="text" name="key" class="span2 search-query" id="stockNo"  placeholder="请输入品牌名或店铺名" />
                        <button type="button" class="btn search">搜索</button>
                        <td>

                    </div>
                </td >
            </tr>
        </table>

    </form>



    <table cellpadding="1" cellspacing="1" width="100%" border="0">

        <tr>
            <!--{if  $keyType == 0}-->
            <th width="20%">品牌名</th>
            <!--{/if}-->
            <!--{if  $keyType == 1}-->
            <th width="20%">店铺名</th>
            <!--{/if}-->
            <th width="10%">评定等级</th>
            <th width="10%">月销总额</th>
            <th width="10%">主营品类</th>
            <th width="20%">操作</th>
        </tr>

        <!--{if $result}-->
        <!--{loop $result $val}-->
        <tr>
            <td>{$val['name']}</td>
            <td>{$val['level']}</td>
            <td>{$val['saleMonth']}</td>
            <td>{$val['mainProduct']}</td>
            <td class="operate">
                <a href="{$this->url($c,'edit',array('id'=>$val['id'], 'type'=>'infoMan'))}">编辑</a>
                <a title="删除商品" class="del" href="{$this->url($c,'del',array('id'=>$val['id']))}">删除</a>
                <a href="{$this->url($c,'addGoods',array('id'=>$val['id'], 'type'=>'infoMan'))}">添加商品</a>
            </td>
        </tr>
        <!--{/loop}-->
        <!--{else}-->
        <tr>
            <td colspan="5">没有数据记录！</td>
        </tr>
        <!--{/if}-->
        <tr>
            <td colspan="4" class="td4">
                <a title="添加入库单" class="btn btn-success " href="{$this->url($c,'addShopBrond',array('type'=> 'infoMan'))}">添加品牌/店铺</a>
            </td>
        </tr>











    </table>

    <!--{/if}-->
    <!--{/if}-->




    <!--{if  $a == 'addShopBrond' ||  $a =='edit' }-->
    <form method="post" action="{$this->url($c, 'save', array('inOutStockNo' => $result['inOutStockNo'],'type' => $type) )}">
        <table cellpadding="1" cellspacing="1" width="100%" border="0">
            <input type="hidden" name="id" value="{$result['id']}" />
            <tr>
                <!--{if  $keyType == 0}-->
                <td class="td1">品牌名称：</td>
                <!--{/if}-->
                <!--{if  $keyType == 1}-->
                <td class="td1">店铺名称：</td>
                <!--{/if}-->
                <td class="td2" colspan="2">
                    <input type="text" size="30" name="name" value="{$a == 'edit' ? $result['name'] : ''}" />
                </td>

            </tr>

            <tr>
                <td class="td1">  类  型 ：</td>
                <td class="td2" colspan="2">

                <input type="radio" name="shopBrandType" value="0" {echo $shopType == 0? 'checked':''}/>店铺&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                <input type="radio" name="shopBrandType" value="1" {echo $shopType == 1? 'checked':''}/>品牌
                </td>
            </tr>


            <tr>
                <td class="td1">页面地址：</td>
                <td class="td2" colspan="2">
                    <input type="text" name="webUrl" value="{$a == 'edit' ? $result['webUrl'] : ''}" />
                </td>
            </tr>
            <tr>
                <td class="td1">月销售总额：</td>
                <td class="td2" colspan="4">
                    <input type="text" name="saleMonth" value="{$a == 'edit' ? $result['saleMonth'] : ''}" />
                </td>
            </tr>
            <tr>
                <td class="td1">宝贝总数：</td>
                <td class="td2" colspan="4">
                    <input type="text" name="goodsAmount" value="{$a == 'edit' ? $result['goodsAmount'] : ''}" />
                </td>
            </tr>
            <tr>
                <td class="td1">主营产品：</td>
                <td class="td2" colspan="2">
                    <select name="mainProduct"   >

                        <option value="裙子" {echo $result['mainProduct']  == '裙子' ? selected : ''}  />裙子</option>
                        <option value="羽绒服" {echo $result['mainProduct']  == '羽绒服' ? selected : ''}  />羽绒服</option>
                        <option value="T恤" {echo $result['mainProduct']  == 'T恤' ? selected : ''}  />T恤</option>
                        <option value="裤子" {echo $result['mainProduct']  == '裤子' ? selected : ''}  />裤子</option>
                        <option value="鞋子" {echo $result['mainProduct']  == '鞋子' ? selected : ''}  />鞋子</option>
                        <option value="外套" {echo $result['mainProduct']  == '外套' ? selected : ''}  />外套</option>
                        <option value="全部" {echo $result['mainProduct']  == '全部' ? selected : ''}  />全部</option>

                    </select>
                </td>
            </tr>
            <tr>
                <td class="td1">评定等级：</td>
                <td class="td2" colspan="2">
                    <select name="level"  >
                        <option value="1" {echo $result['level']  == 1 ? selected : ''}  />1级</option>
                        <option value="2" {echo $result['level']  == 2 ? selected : ''}  />2级</option>
                        <option value="3" {echo $result['level']  == 3 ? selected : ''}  />3级</option>

                    </select>
                </td>
            </tr>


            <tr>
                <th colspan="2" class="td4">
                    <a title="保存供货商" class="btn btn-success save" href="{$this->url($c)}">保 存</a>
                </th>
            </tr>



        </table>
    </form>
    <!--{/if}-->


    <!--{if  $a == 'addGoods'  }-->

    <form method="post" action="{$this->url($c, 'saveGoods', array('id' => $result['id']))}">
        <input type="hidden" name="attach[id]" value="" />
        <input type="hidden" name="uid" value="{$this->admin['id']}" />
        <input type="hidden" name="shopBrandId" value="{$this->admin['id']}" />
        <table>
            <tr>
                <td class="td1" width="25%">商品编号：</td>
                <td class="td2 operate">
                    <input type="text" name="sn" placeholder="请输入商品编号" class="required" value="{$a == 'edit' ? $result['sn'] : ''}"/>
                    <a format="YmdHis" class="sn" href="{$this->url($c)}">自动生成</a>
                </td>
            </tr>
            <tr>
                <td class="td1">商品名称：</td>
                <td class="td2">
                    <input type="text" name="goodsName" placeholder="请输入商品销售价格" class="required" value="{$a == 'edit' ? $result['price'] : ''}" />
                </td>
            </tr>
            <tr>
                <td class="td1">商品URL：</td>
                <td class="td2">
                    <input type="text" name="goodsUrl" placeholder="请输入商品名称" class="required " value="{$a == 'edit' ? $result['title'] : ''}" />
                </td>
            </tr>
            <tr>
                <td class="td1">当前价格：</td>
                <td class="td2">
                    <input type="text" name="price" placeholder="请输入商品名称" class="required " value="{$a == 'edit' ? $result['price'] : ''}" />
                </td>
            </tr>
         <tr>
            <td class="td1">销售数量：</td>
            <td class="td2">
                <input type="text" name="amount" placeholder="请输入商品名称" class="required " value="{$a == 'edit' ? $result['amount'] : ''}" />
            </td>
        </tr>

            <tr>
                <td class="td1">销售排名：</td>
                <td class="td2">
                    <select name="staticsCircle" >
                 
                        <!--{loop $this->rankList $k $v}-->
                        <option value="{$k}" {echo $result['rank'] == $k ?  'selected' : '' }  >{$v}</option>
                        <!--{/loop}-->
                    </select>
                </td>
            </tr>
            <tr>
                <td class="td1">统计周期：</td>
                <td class="td2">
                    <select name="staticsCircle" >
                        <option value="0" {echo $result['staticsCircle'] == 0 ?  'selected' : '' }  >按天统计</option>
                        <option value="1" {echo $result['staticsCircle'] == 1 ?  'selected' : '' }  >按周统计</option>
                        <option value="2" {echo $result['staticsCircle'] == 2 ?  'selected' : '' }  >统计一次</option>
                    </select>
                </td>
            </tr>
            <tr>
                <td class="td1">统计时长：</td>
                <td class="td2">
                    <select name="staticsMonth" id="templateId" >
                        <option value="0" {echo $result['staticsMonth'] == 0 ?  'selected' : '' }  >半个月</option>
                        <option value="1" {echo $result['staticsMonth'] == 1 ?  'selected' : '' }  >一个月</option>
                        <option value="2" {echo $result['staticsMonth'] == 2 ?  'selected' : '' }  >三个月</option>
                    </select>
                </td>
            </tr>
            <tr>
                <td class="td1">商品种类：</td>
                <td class="td2">
                    <select name="picType">
                        <!--{loop $this->salerType $v}-->
                        {eval $select_salerType = $v == $result['salerType'] ? ' selected' : ''}
                        <option value="{$v}"{$select_salerType}>{$v}</option>
                        <!--{/loop}-->
                    </select>
                </td>
            </tr>
            <tr>
                <td class="td1">录入时间：</td>
                <td class="td2 operate">
                    <input type="text" name="dateline" value="{$a == 'edit' ? date($this->setting['timeformat'], $result['dateline']) : date($this->setting['timeformat'])}" readonly />
                    <a href="" format="{$this->setting['timeformat']}" class="dateline">插入当前时间</a>
                </td>
            </tr>
            {template upload}
            <tr>
                <th colspan="2" class="td4"><a title="保存{$this->name}" class="btn btn-success save" href="{$this->url($c)}">保存</a></th>
            </tr>
        </table>
    </form>
    <script type="text/javascript">
        $( ".style,.brand" ).click( function () {
            var c = $( this ).attr( 'class' );
            $( 'input[name="' + c + '"]' ).val( $( this ).html() );
            $( 'input[name="' + c + '"]' ).focus();
            return false;
        });
        $( ".sn, .dateline" ).click( function () {
            var c = $( this ).attr( 'class' );
            $.get( "{$this->url($c, 'get_date')}&format=" + $( this ).attr( 'format' ), function ( result ) {
                $( 'input[name="' + c + '"]' ).val( result );
                $( 'input[name="' + c + '"]' ).focus();
            });
            return false;
        });
    </script>
    <!--{/if}-->


    <!--{if $type == 'infoShow'}-->

    <!-- 信息展示 -->

    <table cellpadding="1" cellspacing="1" border="0" width="100%">
        <tr>
            <td class="td1" width="30%">请选择服装类型：</td>
            <td class="td2" colspan="2">
                <!-- class="required" 必填字段  -->

                <!--  <input type="text" name="discount" placeholder="请输入供货商折扣信息" value="{$a == 'edit' ? $result['discount'] : ''}" />  -->

                <select name="clothType" onchange="template(this.value)">
                    <!--{loop $this->salerType  $k $v}-->
                    <option value="{$k}" {$k == $t?'selected':''}>{$v}</option>
                    <!--{/loop}-->
                </select>

                <script>
                    function template( v ) {
                        var url = "{$this->url($c,'lookHotSalePic',array('type'=>G('type')))}";
                        window.location.href = url + "&t=" + v;
                    }
                </script>

            </td>

        </tr>
    </table>

    <table>
        <!--{if  $result}-->
        <style>

            .slideshow{ height:280px; position:relative;  width:300px;overflow:hidden;}
            .slides_container{ height:280px !important;}
            .slideshow img{ width:300px; height:280px;}
            .pagination{ float:right; position:absolute; bottom:6px; right:6px;}
            .pagination li{ float:left; margin:0 1px;}
            .pagination li a{  float:left; width:16px; height:16px; line-height:16px; font-size:12px;text-align:center;color:#333; background:#FFF; overflow:hidden; display:block;}
            .pagination li.current a{ color:#FFF; background:#06C;}
        </style>
        <!--{loop $result $val}-->

        <tr>
            <td  width=300>
                <div class="slideshow">
                    <div class="slides_container">
                        <!--{if  $val['picAddr1']}-->
                        <a href="#"><img src="{$val['picAddr1']}" /></a>
                        <!--{/if}-->
                        <!--{if  $val['picAddr2']}-->
                        <a href="#"><img src="{$val['picAddr2']}" /></a>
                        <!--{/if}-->
                        <!--{if  $val['picAddr3']}-->
                        <a href="#"><img src="{$val['picAddr3']}" /></a>
                        <!--{/if}-->
                        <!--{if  $val['picAddr0']}-->
                        <a href="#"><img src="{$val['picAddr0']}" /></a>
                        <!--{/if}-->

                    </div>
                </div>
            </td>
            <td width="300" >
                <table>
                    <tr>
                        <td>货号:</td>
                        <td>{$val['materialNo']}</td>
                    </tr>
                    <tr>
                        <td>销售笔数:</td>
                        <td>{$val['total']}</td>
                    </tr>
                    <tr>
                        <td>销售单价:</td>
                        <td>{$val['price']}</td>
                    </tr>
                    <tr>

                        <td><a href="{$this->url($c,'addClothEvaluate', array('type' => 'infoShow','id'=>$val['id']))}">添加评价</a></td>
                        <td><a href="{$this->url($c,'lookClothEvaluate', array('type' => 'infoShow','sn'=>$val['sn']))}">历史评价</a></td>
                    </tr>
                </table>
            </td>

        </tr>



        <!--{/loop}-->
        <script type="text/javascript" src="content/js/slides.min.jquery.js"></script>

        <script type="text/javascript">
            $(".slideshow").slides({
                effect: 'fade',
                play: 5000,
                pause: 2500,
                hoverPause: true
            });
        </script>
        <!--{else}-->
        <tr>
            <td colspan="6">热卖商品信息</td>
        </tr>

        <!--{/if}-->

        <!--{if $pager}-->
        <!--分页开始-->
        <tr>
            <td colspan="6">
                <div class="page">{$pager}</div>
            </td>
        </tr>
        <!--分页结束-->
        <!--{/if}-->



    </table>
    <!--{/if}-->

    <!--{if $type == 'goodsMan'}-->

    <form class="form-search" action="{$this->url($c, 'search_inStock', $this->get())}">
        <table>
            <tr><td class="td1" width="30%"><input type="radio" name="keyType" value="0" checked="checked" />品牌名&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                <input type="radio" name="keyType" value="1" />店铺名</td>
                <td >

                    <div class="input-append">

                        <input type="text" name="key" class="span2 search-query"  placeholder="请输入品牌名或店铺名" />
                        <button type="button" class="btn search">搜索</button>
                        <td>

                    </div>
                </td >
            </tr>
        </table>

    </form>



    <table cellpadding="1" cellspacing="1" width="100%" border="0">

        <tr>
            <th width="10%">商品编号</th>
            <th width="20%">商品名称</th>
            <th width="10%">销售排名</th>
            <th width="10%">商品单价</th>
            <th width="20%">操作</th>
        </tr>

        <!--{if $result}-->
        <!--{loop $result $val}-->
        <tr>
            <td>{$val['name']}</td>
            <td>{$val['level']}</td>
            <td>{$val['saleMonth']}</td>
            <td>{$val['mainProduct']}</td>
            <td class="operate">
                <a href="{$this->url($c,'edit',array('id'=>$val['id'], 'type'=>'infoMan'))}">编辑</a>
                <a title="删除商品" class="del" href="{$this->url($c,'del',array('id'=>$val['id']))}">删除</a>
                <a href="{$this->url($c,'addGoods',array('id'=>$val['id'], 'type'=>'infoMan'))}">添加商品</a>
            </td>
        </tr>
        <!--{/loop}-->
        <!--{else}-->
        <tr>
            <td colspan="5">没有数据记录！</td>
        </tr>
        <!--{/if}-->
        <tr>
            <td colspan="4" class="td4">
                <a title="添加入库单" class="btn btn-success " href="{$this->url($c,'addShopBrond',array('type'=> 'infoMan'))}">添加品牌/店铺</a>
            </td>
        </tr>











    </table>

    <!--{/if}-->







</div>
<!-- artile end -->
{template footer}
